Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Movie Functions


ConvertFileToMovieFile

The ConvertFileToMovieFile takes a specified file and converts it to a movie file.

pascal OSErr ConvertFileToMovieFile (const FSSpec *inputFile,
                                     const FSSpec *outputFile,
                                     OSType creator, 
                                     ScriptCode scriptTag, 
                                     short *resID, long flags,
                                     ComponentInstance userComp,
                                     MovieProgressProcPtr proc,
                                     long refCon);
inputFile
Contains a pointer to the file system specification for the file to be converted into a movie file.
outputFile

Contains a pointer to the file specification for the destination movie file.
creator
Specifies the creator value for the file if it is a new one.
scriptTag
Specifies the script in which the movie file should be converted. Use the Script Manager constant smSystemScript to use the system script; use the smCurrentScript constant to use the current script. See Inside Macintosh: Text for more information about scripts and script tags.
resID
Contains a pointer to a field that is to receive the resource ID of the file to be converted. If you don't want to receive the resource ID, set this parameter to nil.
flags
Controls movie file conversion flags. The following value is valid:
createMovieFileDeleteCurFile
Indicates whether to delete an existing file. If you set this flag to 1, the Movie Toolbox deletes the file (if it exists) before converting the new movie file. If you set this flag to 0 and the file specified by the fileSpec parameter already exists, the Movie Toolbox uses the existing file. In this case, the toolbox ensures that the file has both a data and a resource fork.
userComp
Indicates a component or component instance of the movie export component you want to perform the conversion. Otherwise, set this parameter to 0 for the Movie Toolbox to choose the appropriate component. If you pass in a component instance, it will be used by ConvertFileToMovieFile. This allows you to communicate directly with the component before using this function to establish any conversion parameters. If you pass in a component ID, an instance is created and closed within this function. For details on movie export components, see Inside Macintosh: QuickTime Components.
proc
Points to your progress function. To remove a movie's progress function, set this parameter to nil. Set this parameter to -1 for the Movie Toolbox to provide a default progress function. See "Progress Functions," which begins on page 2-333, for the interface your progress function must support.
refCon
Specifies a reference constant. The Movie Toolbox passes this value to your progress function.
DESCRIPTION
Because some conversions may take a nontrivial amount of time, you can pass a standard movie progress function in the proc and refCon parameters.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996